<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>活动管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {

		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/phy/tAction/">活动列表</a></li>
		<shiro:hasPermission name="phy:tAction:edit"><li><a href="${ctx}/phy/tAction/form">活动添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="tAction" action="${ctx}/phy/tAction/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>医生名称：</label>
				<form:input path="doctorName" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>所属机构：</label>
				<form:input path="tenantName" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>状态：</label>
				<form:select path="status" class="input-small">
					<form:option value="" label="全部"/>
					<form:options items="${fns:getDictList('action_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<shiro:hasPermission name="phy:sys:id"><th style="padding-bottom: 10px">id</th></shiro:hasPermission>
				<th style="padding-bottom: 10px">所属机构</th>
				<th style="padding-bottom: 10px">医生名称</th>
				<th>坐诊时间</th>
				<th>排序</th>
				<th>具体时间，逗号分隔</th>
				<th>状态</th>
				<th>拼团状态</th>
				<th>最低人数</th>
				<th>报名人数</th>
				<th>报名费用</th>
				<th>号源数</th>
				<th>开始时间</th>
				<th>结束时间</th>
				<th>更新时间</th>
<%--				<th>备注信息</th>--%>
				<shiro:hasPermission name="phy:tAction:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="tAction">
			<tr>
				<shiro:hasPermission name="phy:sys:id">
					<td>
							${tAction.id}
					</td>
				</shiro:hasPermission>
				<td>${tAction.tenant.tenantName}</td>
				<c:if test="${empty tAction.doctor.remarks}">
					<td>${tAction.doctor.doctorName}</td>
				</c:if>
				<c:if test="${not empty tAction.doctor.remarks}">
					<td>${tAction.doctor.doctorName}(${tAction.doctor.remarks})</td>
				</c:if>
				<td>
					<fmt:formatDate value="${tAction.actionDate}" pattern="yyyy-MM-dd"/>
				<td>
						${tAction.sort}
				</td>
				<td>
					${tAction.actionDetailDate}
				</td>
				<td>
						${fns:getDictLabel(tAction.status, 'action_status', '')}
				</td>
				<td>
						${fns:getDictLabel(tAction.groupStatus, 'group_status', '')}
				</td>
				<td>${tAction.minPeople}</td>
				<td>${tAction.actionNum}</td>
				<td>${tAction.fee}</td>
				<td>${tAction.amStock + tAction.pmStock}</td>
<%--				<td>--%>
<%--					${tAction.rule}--%>
<%--				</td>--%>
				<td>
					<fmt:formatDate value="${tAction.beginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					<fmt:formatDate value="${tAction.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					<fmt:formatDate value="${tAction.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
<%--				<td>--%>
<%--					${tAction.remarks}--%>
<%--				</td>--%>
				<shiro:hasPermission name="phy:tAction:edit"><td>
    				<a href="${ctx}/phy/tAction/form?id=${tAction.id}">修改</a>
					<a href="${ctx}/phy/tAction/delete?id=${tAction.id}" onclick="return confirmx('确认要删除该活动吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
